package com.cta.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name = "cta_profile")
public class Profile implements BaseEntity {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "cta_profile_seq")
	@SequenceGenerator(name = "cta_profile_seq", sequenceName = "cta_profile_seq")
	@Column(name = "id", unique = true, nullable = false)
	private Long id;

	@Column(name = "sequence")
	private Integer sequence;

	@Column(name = "name")
	private String name;

	@Column(name = "description")
	private String description;

	@Column(name = "num_of_bytes")
	private Integer numOfBytes;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "pbx_id", nullable = false)
	private PBX pbx;

	public Profile() {}
	
	public Profile(Integer sequence, String name, String description, Integer numOfbyte, PBX pbx) {
		this.sequence = sequence;
		this.name = name;
		this.description = description;
		this.numOfBytes = numOfbyte;
		this.pbx = pbx;
	}
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Integer getNumOfBytes() {
		return numOfBytes;
	}

	public void setNumOfBytes(Integer numOfBytes) {
		this.numOfBytes = numOfBytes;
	}

	public Integer getSequence() {
		return sequence;
	}

	public void setSequence(Integer sequence) {
		this.sequence = sequence;
	}

	public PBX getPbx() {
		return pbx;
	}

	public void setPbx(PBX pbx) {
		this.pbx = pbx;
	}
}
